package com.zsc.edu.gateway.modules.iot.tsl.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zsc.edu.gateway.modules.iot.record.entity.RecordData;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @author zhuang
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@TableName("iot_event_log")
public class EventLog {
    /**
     * 序列化主键（有数据库提供，非自增）
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 名称
     */
    private String name;

    /**
     * 关联上报数据id
     */
    private String recordId;

    /**
     * 关联上报数据
     */
    @TableField(exist = false)
    private RecordData recordData;

    /**
     * 触发时间
     */
    private LocalDateTime triggerTime;

    /**
     * 部门ID(权限)
     */
    @TableField(value = "dept_id", fill = FieldFill.INSERT)
    public Long deptId;

    /**
     * 创建人ID(权限)
     */
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    public Long createId;

}
